package cn.yuanqiao.web.controller.archive.cqbctuisong;
/**
 * @author 赵常飞
 * @date 2024/6/29 17:45
 */

import cn.yuanqiao.archive.cqbctuisong.service.ICqbcTuiSongService;
import cn.yuanqiao.common.core.controller.BaseController;
import cn.yuanqiao.common.core.domain.AjaxResult;
import cn.yuanqiao.common.annotation.Log;
import cn.yuanqiao.common.enums.BusinessType;
import com.alibaba.fastjson2.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 *@Author: 赵常飞
 *@Date: 2024/6/29 17:45
 *@Description:
 *@Note:
 */
@RestController
@RequestMapping("/archive/cqbcts")
public class CqbcTuiSongController extends BaseController {
    @Autowired
    private ICqbcTuiSongService cqbcTuiSongService;
    @Log(title = "推送到长期保存系统", businessType = BusinessType.OTHER)
    @PostMapping("/pushtocqbc")
    public AjaxResult pushtocqbc(@RequestBody JSONObject json) throws  IOException {
        cqbcTuiSongService.pushtocqbc(json);
        return AjaxResult.success();
    }
    @Log(title = "查询展示字段", businessType = BusinessType.SELECT)
    @PostMapping("/getthbytreenode")
    public AjaxResult getthbytreenode(@RequestBody JSONObject json)
    {
        List<Map<String,String>> list = cqbcTuiSongService.getthbytreenode(json);
        return AjaxResult.success(list);
    }
    @Log(title = "批量打包", businessType = BusinessType.OTHER)
    @PostMapping("/plpakeage")
    public AjaxResult plpakeage(@RequestBody JSONObject json)
    {
        cqbcTuiSongService.plpakeage(json);
        return AjaxResult.success();
    }

    @Log(title = "批量四性检测", businessType = BusinessType.OTHER)
    @PostMapping("/plsixing")
    public AjaxResult plsixing(@RequestBody JSONObject json)
    {
        cqbcTuiSongService.plsixing(json);
        return AjaxResult.success();
    }
}
